#ifndef INDEX_HPP
#define INDEX_HPP

#include <tuple>

inline int indexOf(int i,int j,int cols){
    return (j-1)*cols+i-1;
}

inline std::pair<int,int> positionOf(int index,int cols){
    //ret.first = i, ret.second = j
    //i and j starts at 1
    return std::make_pair(index%cols+1,index/cols+1);
}

#endif // INDEX_HPP


